package com.hua.demo.edu.controller.front;/*
@Author:张华
@File:coursefront.java
@Time:2021/12/4 13:37
*/

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hua.R;
import com.hua.demo.edu.entity.Course;
import com.hua.demo.edu.entity.Teacher;
import com.hua.demo.edu.entity.frontvo.CourseFrontVo;
import com.hua.demo.edu.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/edu/front/course")
public class coursefront {
    @Autowired
    CourseService courseService;
    @PostMapping("fenye/{page}/{num}")
    public R tiaojian(@PathVariable long page, @PathVariable long num, @RequestBody CourseFrontVo courseFrontVo){
        Page<Course> pagecourse = new Page<>(page,num);
        Map<String,Object> map=courseService.getfrontcourselist(pagecourse,courseFrontVo);
        return R.ok().data(map);
    }
}
